
Version:=20070809
ModuleName:=procps
Sub:=cvs

Object:=$(ModuleName).tgz
ObjectDir:=$(ModuleName)
ObjectSource:=$(ModuleName)_$(Version)_$(Sub).tar.gz

Object2:=systools.tgz

DependFiles:=
InstaLibDir:=usr/lib
InstaSbinDir:=usr/sbin

.PHONY: all clean dist_clean

all:$(Object) $(Object2)
	
$(Object):$(ObjectSource) 
	tar -xzf $(ObjectSource) && patch -p 0 < DelGccOperation.patch && rm -rf usr && mkdir -p usr/lib usr/sbin/
	$(MAKE) -C $(ObjectDir)
	cp -rf $(ObjectDir)/top $(InstaSbinDir)
	cp -af $(ObjectDir)/proc/libproc.so.2.0.18 $(ObjectDir)/proc/libproc.so $(InstaLibDir)
	tar -czf $(Object) usr

$(Object2):cenv.sh listen_log.sh menv.sh reboot_service.sh
	rm -rf usr && mkdir -p $(InstaLibDir) $(InstaSbinDir)
	cp -rf /usr/sbin/useradd /usr/bin/gpasswd $(InstaSbinDir)
	cp -rf /lib/libselinux.so.1 /lib/libsepol.so.1 $(InstaLibDir)
	cp -rf /usr/sbin/ntpdate $(InstaSbinDir)
	cp -rf /usr/bin/find $(InstaSbinDir)
	chmod +x cenv.sh
	cp -rf cenv.sh $(InstaSbinDir)
	chmod +x menv.sh
	cp -rf menv.sh $(InstaSbinDir)
	chmod +x reboot_service.sh
	cp -rf reboot_service.sh $(InstaSbinDir)
	cp -rf /usr/bin/xargs $(InstaSbinDir)
	chmod +x listen_log.sh
	cp -rf listen_log.sh $(InstaSbinDir)
	cp -rfl /lib/libcap.so.1 /lib/libcap.so.1.10 $(InstaLibDir)
	tar -czf $(Object2) usr

clean:
	rm -rf $(Object) usr $(Object2)

dist_clean:clean
	rm -rf $(ObjectDir) $(ObjectSource) 
	
include ../Makefile.Res
